package com.ruoyi.ex.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ex.mapper.ExStudyCountMapper;
import com.ruoyi.ex.domain.ExStudyCount;
import com.ruoyi.ex.service.IExStudyCountService;

/**
 * ex_study_countService业务层处理
 *
 * @author zzx
 * @date 2023-07-14
 */
@Service
public class ExStudyCountServiceImpl implements IExStudyCountService {
    @Autowired
    private ExStudyCountMapper exStudyCountMapper;

    /**
     * 查询ex_study_count
     *
     * @param id ex_study_count主键
     * @return ex_study_count
     */
    @Override
    public ExStudyCount selectExStudyCountById(Long id) {
        return exStudyCountMapper.selectExStudyCountById(id);
    }

    /**
     * 查询ex_study_count列表
     *
     * @param exStudyCount ex_study_count
     * @return ex_study_count
     */
    @Override
    public List<ExStudyCount> selectExStudyCountList(ExStudyCount exStudyCount) {
        return exStudyCountMapper.selectExStudyCountList(exStudyCount);
    }

    /**
     * 新增ex_study_count
     *
     * @param exStudyCount ex_study_count
     * @return 结果
     */
    @Override
    public int insertExStudyCount(ExStudyCount exStudyCount) {
        exStudyCount.setCreateTime(DateUtils.getNowDate());
        return exStudyCountMapper.insertExStudyCount(exStudyCount);
    }

    /**
     * 修改ex_study_count
     *
     * @param exStudyCount ex_study_count
     * @return 结果
     */
    @Override
    public int updateExStudyCount(ExStudyCount exStudyCount) {
        return exStudyCountMapper.updateExStudyCount(exStudyCount);
    }

    /**
     * 批量删除ex_study_count
     *
     * @param ids 需要删除的ex_study_count主键
     * @return 结果
     */
    @Override
    public int deleteExStudyCountByIds(Long[] ids) {
        return exStudyCountMapper.deleteExStudyCountByIds(ids);
    }

    /**
     * 删除ex_study_count信息
     *
     * @param id ex_study_count主键
     * @return 结果
     */
    @Override
    public int deleteExStudyCountById(Long id) {
        return exStudyCountMapper.deleteExStudyCountById(id);
    }

    @Override
    public List<ExStudyCount> getStudyCountByStu(Long userId) {
        return exStudyCountMapper.getStudyCountByStu(userId);
    }
}
